package org.study.bookmanagerclientbyswing;

import com.formdev.flatlaf.FlatDarkLaf;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ApplicationContext;
import org.springframework.web.reactive.config.EnableWebFlux;
import org.study.bookmanagerclientbyswing.ui.StartView.StartView;

import javax.swing.*;

@SpringBootApplication
@EnableWebFlux
public class BookManagerClientbySwingApplication {
    public static void main(String[] args) throws UnsupportedLookAndFeelException {
        UIManager.setLookAndFeel(new FlatDarkLaf());
        JFrame.setDefaultLookAndFeelDecorated(true);
        JDialog.setDefaultLookAndFeelDecorated(true);
        SpringApplicationBuilder builder = new SpringApplicationBuilder(BookManagerClientbySwingApplication.class);
        ApplicationContext context =builder.headless(false).run(args);//默认无头模式运行，这里关闭
        StartView startView = context.getBean(StartView.class);
        SwingUtilities.invokeLater(() -> {
            startView.setVisible(true);
        });
    }
}
